﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using SMS.Entities;

namespace SMS.Web.Service
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "AdminService" in code, svc and config file together.
    public class AdminService : IAdminService
    {
        public void DoWork()
        {
        }

        public int ActivateDeActivateUserLogin(string username, string mode,out SMSException serviceError)
        {
            try
            {
                serviceError = null;
                return new SMS.DAL.AdminDA().ActivateDeActivateUserLogin(username, mode);
            }
            catch (Exception ex)
            {
                serviceError = new SMSException(ex);
                return 0;
            }
        }

        public int ManageUserRoleSetting(string username, int role, out SMSException serviceError)
        {
            try
            {
                serviceError = null;
                return new SMS.DAL.AdminDA().ManageUserRoleSetting(username, role);
            }
            catch (Exception ex)
            {
                serviceError = new SMSException(ex);
                return 0;
            }
        }
    }
}
